(function(){
  q=""+(window.getSelection?window.getSelection():document.selection.createRange().text);
  if(!q){
  q=prompt("Search words","");}
  if(q!=null)
    {
      location="http://www.google.com/search?q="+escape(q).replace(/%20/g,"+");
    }
})();
